{% extends "site.html" %}
{% block title %}{% endblock %}
{% block stylesheet %}{% load media %}{% media_prefix %}css/sklad.css{% endblock %}
{% block extrastyle %}<link rel="stylesheet" type="text/css" href="{% media_prefix %}css/sklad-tree.css">{% endblock %}
{% block treejs %}<script type="text/javascript" src="{% media_prefix %}js/tree.js"></script>{% endblock %}

{% block globalconteiner %}
<h1>Склад</h1>
<div id="search">
    <form action="{% url search %}" method="GET">
        <input name="search_query" type="text" size="60" value="{{ query }}">
        <input class="default" type="submit" value="Найти"/> 
    </form>
</div>
<div id="main_menu">
    <A href="{% url index %}">Запчасти</A> 
    <A href="{% url document_all %}">Документы</A> 
</div>
{% block main %}

<table border="0" class="table_layout" style="margin-bottom:30px;">
    <tr>
        <td>
            <div id="contentleft">
            {% if perms.sklad.add_category %}
                {% if currentcategory %}
                    <p class="item_menu">
                        <a href="{% url category_create currentcategory %}">Новая подкатегория</a>
                    </p>
                {% else %}
                    <p class="item_menu">
                        <a href="{% url category_root_create %}">Новая категория</a>
                    </p>
                {% endif %}
            {% endif %}
          
            <div class="treeview">   
                <ul>   
                    <li>
                        <div><p><a href="#" class="sc" onclick="return UnHide(this)"><img src="{% media_prefix %}img/minus.gif"/></a>
                        <a href="#">Категории</a></p></div>
                        <ul>
                            {% load tree %}
                            {% tree category_tree|astree:"parent" %}
                                <a href="{% url category_view item.id %}" id="ti_{{item.id}}">
                                <img src="{% if item.picture %}{% media_prefix %}{{ item.picture }}{% else %}{% media_prefix %}img/treefolder.png{% endif %}" class="i" />{{ item.name }}</a>
                            {% endtree %}
                        </ul>
                    </li>
                </ul>
            </div>
            
            <script language="JavaScript">                
                UnHideOpenNodes();
                
                {% for item in category_path %}
                UnHideNodeItem('tn_'+{{item.id}});
                {% endfor %} 
                
                var selectitem = document.getElementById('ti_{{ currentcategory }}');
                if(selectitem) 
                    selectitem.style.fontWeight = 'bold';  
                
           </script>               
      
            </div>
        </td>
        <td width="99%">
            <div id="contentright">
                {% if messages %}
                <ul id="messages">
                    {% for message in messages %}
                    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
                    {% endfor %}
                </ul>  
                {% endif %}
                {% block path_menu %}
                <div id="view_menu">
                    <a href="{% url part_delivery %}">Выдача</a>                
                    <a href="{% url part_receipt %}">Поступление</a>
                    {% block printlink%}{% endblock %}
                </div>
                <div id="path-menu">
                    <A href="{% url index %}">Начало</A>
                    {% for cp in category_path %}
                        / <A href="{% url category_view cp.id %}">{{ cp.name }}</A>
                    {% endfor %} 
                </div>
                {% endblock %}
                {% block contenttitle %}
                {% endblock %} 
    
                {% block content %}
                    <h5>content</h5>
                {% endblock %}
            </div>
        </td>
    </tr>
</table>
{% endblock %}

{% endblock %}

{% block meta %}
{% if debug %}
    {% include "debug_inf.html" %}
{% endif %}
Версия:&nbsp;{{ version_string }}&nbsp;&nbsp;&nbsp;&nbsp;Дата:&nbsp;01.04.2010

{% endblock %}	

